| Previous | Chapter contents | Chapter top | Section top | Next |
You can use the QTVRSetTiltAngle function to set the tilt angle of a QuickTime VR movie.
OSErr QTVRSetTiltAngle (QTVRInstance qtvr, floattiltAngle);
The QTVRSetTiltAngle function sets the tilt angle of the QuickTime VR movie specified by the qtvr parameter to the value specified by the tiltAngle parameter. That value is constrained by the maximum and minimum tilt angles of the movie. If the angle falls outside of those constraints and the control setting kQTVRWrapTilt is disabled, the angle is set to the minimum or maximum, whichever is closer. If wrapping is enabled, the tilt angle is clipped to fall within the constraints. Tilt angle values are also clipped if the requested tilt angle, when combined with the current pan angle and field of view, would cause an image to lie outside the current constraints.
QTVRSetTiltAngle returns the result code constraintReachedErr if wrapping is off and the angle is set to the minimum or maximum constraint value.
The pan and tilt angles are subject to the current pan and tilt range constraints, as imposed by the viewing limits and the current field of view. Accordingly, if you want to change the field of view, you should do so before adjusting the pan or tilt angles. Otherwise, the pan and tilt angles are clipped against the current field of view, which may result in an incorrect view when you alter the field of view.
Use QTVRGetTiltAngle (link) to get the tilt angle of a movie. Use QTVRGetViewingLimits (link) to get the current viewing limits of a movie. Listing 2-4 illustrates the use of QTVRSetTiltAngle .
| Previous | Chapter contents | Chapter top | Section top | Next |